#!/usr/bin/env php
<script language="php">

error_log("calling clam.php\n");

class ClamScan
{
    private $clamAdapter;

    public function __construct()
    {
        error_log("Constructing the clamScan!\n");
        $this->clamAdapter = new ClamAVAdapter(`which clamscan`);
    }

    public function update()
    {
        return `sudo freshclam`;
    }
    
    public function scan($dir)
    {
        return $this->clamAdapter->scan(array($dir));
    }
}

$scanner = new ClamScan();
$scanner->scan($argv[1]);
</script>
